//
//  AddNewAccoutViewController.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/11.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "AddNewAccoutViewController.h"

@interface AddNewAccoutViewController ()

@property(nonatomic ,strong) UITextField *passWord;
@property(nonatomic ,strong) UITextField *passWord1;
@end

@implementation AddNewAccoutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)createView{
    self.title=@"绑定支付宝";
    UIView *bottom=[[UIView alloc]initWithFrame:CGRectMake(0, 0, MainW, 100)];
    bottom.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:bottom];
    MYLabel*UserName=[[MYLabel alloc]init];
    UserName.text=@"昵称";
    UserName.textColor=TextColor6;
    [bottom addSubview:UserName];
    NSString*str=@"支付宝啊";
    CGSize size=[str sizeWithAttributes:@{NSFontAttributeName:UserName.font}];
    MYLabel*AcooutName=[[MYLabel alloc]init];
    AcooutName.text=@"支付宝";
    AcooutName.textColor=TextColor6;
    [bottom addSubview:AcooutName];
    UIView*v=[[UIView alloc]init];
    v.backgroundColor=Gray_Color;
    [bottom addSubview:v];
    
    
    self.passWord=[[UITextField alloc]initWithFrame:CGRectMake(10, 30, MainW-20, 49)];
    self.passWord.placeholder=MyString(@"请填写您的支付宝名称");
    [self.passWord setValue:[UIFont boldSystemFontOfSize:14]forKeyPath:@"_placeholderLabel.font"];
    self.passWord.font=FontAndStyle14;
    self.passWord.textColor=TextColor3;
    //self.passWord.keyboardType=UIKeyboardTypeNumberPad;
    self.passWord.borderStyle=0;
    [bottom addSubview:self.passWord];
    
    self.passWord1=[[UITextField alloc]initWithFrame:CGRectMake(10, 110, MainW-20, 49)];
    self.passWord1.font=FontAndStyle14;
    self.passWord1.textColor=TextColor3;
    self.passWord1.placeholder=MyString(@"请填写您的支付宝账户");
    [self.passWord1 setValue:[UIFont boldSystemFontOfSize:14]forKeyPath:@"_placeholderLabel.font"];
    //self.passWord1.keyboardType=UIKeyboardTypeNumberPad;
    self.passWord1.borderStyle=0;
    [bottom addSubview:self.passWord1];
    UIButton *MySureBtn=[[UIButton alloc]initWithFrame:CGRectMake(10, 220, MainW-20, 50)];
    [MySureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [MySureBtn setTitle:MyString(@"确认") forState:UIControlStateNormal];
    [MySureBtn addTarget:self action:@selector(SureClick) forControlEvents:UIControlEventTouchUpInside];
    [MySureBtn setBackgroundColor:Red_Color];
    [self.view addSubview:MySureBtn];
    ViewRadius(MySureBtn, 5);

    
    [UserName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo((50-size.height)/2);
        make.left.equalTo(10);
        make.width.mas_equalTo(size.width);
        make.height.mas_equalTo(size.height);
    }];
    [self.passWord mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(0);
        make.left.equalTo(UserName.mas_right).offset(15);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(49);
    }];
    [v mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.passWord.mas_bottom);
        make.left.equalTo(0);
        make.width.mas_equalTo(MainW);
        make.height.mas_equalTo(1);
    }];
    [AcooutName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(bottom.mas_centerY).offset(25);
        make.left.equalTo(10);
        make.width.mas_equalTo(size.width);
        make.height.mas_equalTo(size.height);
    }];
    [self.passWord1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(v.mas_bottom);
        make.left.equalTo(AcooutName.mas_right).offset(15);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(49);
    }];
    [MySureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(bottom.mas_bottom).offset(30);
        make.right.mas_equalTo(-10);
        make.left.mas_equalTo(10);
        make.height.mas_equalTo(50);
    }];
    if (self.styple!=100) {
        self.title=@"绑定微信";
        AcooutName.text=@"微信";
        self.passWord.placeholder=@"请填写您的微信名称";
        self.passWord1.placeholder=@"请填写您的微信账号";
    }
    
}
//确定
-(void)SureClick{
    //NSLog(@"确定");
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.passWord resignFirstResponder];
    [self.passWord1 resignFirstResponder];
}

@end
